/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryUserShare;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DeliveryUserShareMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_user_share",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_user_share (id, user_id, ",
        "share_url, ticket, ",
        "expires_time, create_time)",
        "values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, ",
        "#{shareUrl,jdbcType=VARCHAR}, #{ticket,jdbcType=VARCHAR}, ",
        "#{expiresTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(DeliveryUserShare record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryUserShareSqlProvider.class, method="insertSelective")
    int insertSelective(DeliveryUserShare record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, user_id, share_url, ticket, expires_time, create_time",
        "from delivery_user_share",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="share_url", property="shareUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="ticket", property="ticket", jdbcType=JdbcType.VARCHAR),
        @Result(column="expires_time", property="expiresTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    DeliveryUserShare selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryUserShareSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryUserShare record);

    /* @mbggenerated */
    @Update({
        "update delivery_user_share",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "share_url = #{shareUrl,jdbcType=VARCHAR},",
          "ticket = #{ticket,jdbcType=VARCHAR},",
          "expires_time = #{expiresTime,jdbcType=TIMESTAMP},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryUserShare record);
}